package o;

import android.text.TextUtils;
import com.huawei.hms.framework.network.restclient.hianalytics.HianalyticsData;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.Map;
import java.util.Queue;
import java.util.UUID;

public class dzl {
    private static String ˊ = HianalyticsData.ERROR_CODE;
    private static Map<String, Queue<dzm>> ˋ = new HashMap();
    private static String ˏ = "";

    public static void ˋ() {
        ˏ = UUID.randomUUID().toString().replace("-", "");
    }

    public static void ˏ() {
        ˏ = "";
    }

    public static void ˏ(String str, long j) {
        ˊ("022", ॱ(ˊ, ˏ + "_" + str + "_" + ॱ(j)));
    }

    public static void ˋ(String str, String str2) {
        ˊ("023", ॱ(ˊ, ˏ + "_" + str + "_" + str2));
    }

    private static String ॱ(long j) {
        return String.valueOf(System.currentTimeMillis() - j);
    }

    private static LinkedHashMap<String, String> ॱ(String str, String str2) {
        LinkedHashMap<String, String> linkedHashMap = new LinkedHashMap();
        linkedHashMap.put(str, str2);
        return linkedHashMap;
    }

    private static void ˊ(String str, LinkedHashMap<String, String> linkedHashMap) {
        if (!TextUtils.isEmpty(ˏ)) {
            CharSequence ॱ = eqp.ॱ();
            if (TextUtils.isEmpty(ॱ)) {
                Logger.e("AnalyticsRecordCache", "homeCountry is empty");
                return;
            }
            Queue queue = (Queue) ˋ.get(ॱ);
            if (queue == null) {
                queue = new LinkedList();
            }
            dzm o_dzm = new dzm();
            o_dzm.ॱ(cdj.ˏ() + str);
            o_dzm.ˎ(linkedHashMap);
            Logger.ˎ("AnalyticsRecordCache", "b=" + queue.offer(o_dzm));
            ˋ.put(ॱ, queue);
        }
    }

    public static Queue<dzm> ॱ(String str) {
        return (Queue) ˋ.get(str);
    }
}
